#include <iostream>
using namespace std;

int myHeight()
{
    return 70;
}
int myAge()
{
    return 30;
}
class Person
{
public:
    /*初始化列表*/
    Person(int height, int age) : m_height(myHeight()), m_age(myAge()) {}
    // {
    //     m_age = age;
    //     m_height = height;
    // }

public:
    int m_height;
    int m_age;
};
class Student
{
public:
    /*错误使用*/
#if 0
    Student() : 
    {
        Student(0, 0);
        cout << "无参构造\n";
    }
#endif
    Student() : Student(0, 0)
    {
        cout << "无参构造\n";
    }
    /*初始化列表*/
    Student(int height, int age) : m_height(height), m_age(age)
    {
        cout << "带参构造\n";
    }

public:
    int m_height;
    int m_age;
};
int main()
{
    Student stu;
    cout << "age=" << stu.m_age << "height=" << stu.m_height << endl;

    return 0;
}